package org.dingyom.gift.clients;

import feign.hystrix.FallbackFactory;
import org.dingyom.gift.dto.SmsDto;
import org.dingyom.gift.util.AjaxResult;
import org.springframework.stereotype.Component;

@Component
public class SmsClientFallbackFactory implements FallbackFactory<SmsClient> {

    /**
     * 降级回调
     * @param cause
     * @return
     */
    @Override
    public SmsClient create(Throwable cause) {
        return new SmsClient() {
            @Override
            public AjaxResult sendSms(String tel) {
                return null;
            }

            @Override
            public AjaxResult verify(SmsDto dto) {
                return null;
            }
        };
    }
}
